{% extends "shop/base.html" %}

{% block title %}
    结账
{% endblock %}

{% block content %}
    <h1>结账</h1>
    <div class="order-info">
        <h3>订单</h3>
        <ul>
            {% for item in cart %}
                <li>
                    {{ item.quantity }} x {{ item.product.name }}
                    <span>¥ {{ item.total_price }}</span>
                </li>
            {% endfor %}
        </ul>
        <p> 总额：¥ {{ cart.get_total_price }}</P>
    </div>

    <form action="." method="post" class="order-form">
        {{ form.as_p }}
        <p><input type="submit" value="下单"></p>
        {% csrf_token %}
    </form>
{% endblock %}